Crate postgresql_archive

source ·
Expand description

§postgresql_archive

Code Coverage Benchmarks License Semantic Versioning

Retrieve and extract PostgreSQL on Linux, MacOS or Windows.

§Table of contents

§Examples

§Asynchronous API

use postgresql_archive::{extract, get_archive, Result, LATEST};

#[tokio::main]
async fn main() -> Result<()> {
    let (archive_version, archive) = get_archive(&LATEST).await?;
    let out_dir = std::env::temp_dir();
    extract(&archive, &out_dir).await
}

§Synchronous API

#[cfg(feature = "blocking")] {
use postgresql_archive::LATEST;
use postgresql_archive::blocking::{extract, get_archive};

let (archive_version, archive) = get_archive(&LATEST).unwrap();
let out_dir = std::env::temp_dir();
let result = extract(&archive, &out_dir).unwrap();
}

§Feature flags

postgresql_archive uses [feature flags] to address compile time and binary size uses.

The following features are available:

NameDescriptionDefault?
blockingEnables the blocking APINo

§Supported platforms

postgresql_archive supports all platforms provided by theseus-rs/postgresql-binaries:

OSTarget
Linuxaarch64-unknown-linux-gnu
Linuxaarch64-unknown-linux-musl
Linuxarm-unknown-linux-gnueabi
Linuxarm-unknown-linux-gnueabihf
Linuxarm-unknown-linux-musleabi
Linuxarm-unknown-linux-musleabihf
Linuxarmv5te-unknown-linux-gnueabi
Linuxarmv7-unknown-linux-gnueabihf
Linuxarmv7-unknown-linux-musleabihf
Linuxi586-unknown-linux-gnu
Linuxi586-unknown-linux-musl
Linuxi686-unknown-linux-gnu
Linuxi686-unknown-linux-musl
Linuxmips64-unknown-linux-gnuabi64
Linuxpowerpc64le-unknown-linux-gnu
Linuxpowerpc64le-unknown-linux-musl
Linuxs390x-unknown-linux-gnu
Linuxs390x-unknown-linux-musl
Linuxx86_64-unknown-linux-gnu
Linuxx86_64-unknown-linux-musl
MacOSaarch64-apple-darwin
MacOSx86_64-apple-darwin
Windowsx86_64-pc-windows-msvc

§Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

§License

Licensed under either of

at your option.

PostgreSQL is covered under The PostgreSQL License.

§Notes

Uses PostgreSQL binaries from theseus-rs/postgresql-binaries.

Modules§

Structs§

  • PostgreSQL version struct. The version is a simple wrapper around a string. Actively supported major versions of PostgreSQL are defined as constants. The oldest supported version is will be marked as deprecated. Deprecated versions will be removed in a future release following semver conventions for this crate.

Enums§

  • PostgreSQL archive errors

Constants§

  • The latest PostgreSQL version
  • V12Deprecated
    The latest PostgreSQL version 12
  • The latest PostgreSQL version 13
  • The latest PostgreSQL version 14
  • The latest PostgreSQL version 15
  • The latest PostgreSQL version 16

Functions§

Type Aliases§

  • PostgreSQL archive result type